package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysLabel;
import com.jk.smartelderlycare.interfaces.SysLabelServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysLabelController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/14 15:34
 */
@RestController
@Slf4j
public class SysLabelController implements SysLabelServiceApi {
    @Autowired
    private SysLabelService sysLabelService;
    /**
     * @description: 后端分页查询
     * @param: [sysLabel, pageNum, pageSize]
     * @return: com.jk.smartelderlycare.pojo.PagedResponse<com.jk.smartelderlycare.dto.SysLabel>
     * @author hhk
     * @date: 2024/11/14 15:36
     */
    @Override
    public PagedResponse<SysLabel> findSysLabelPagimationList(SysLabel sysLabel, Integer pageNum, Integer pageSize) {
        return sysLabelService.findSysLabelPagimationList(sysLabel,pageNum,pageSize);
    }
    /**
     * @description: 新增
     * @param: [sysLabel]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 15:37
     */
    @Override
    public void addSysLabel(SysLabel sysLabel) {
        sysLabelService.addSysLabel(sysLabel);
    }
    /**
     * @description: 根据id删除
     * @param: [labelId]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 15:37
     */
    @Override
    public void deleteSysLabelByLabelId(Long labelId) {
        sysLabelService.deleteSysLabelByLabelId(labelId);
    }
    /**
     * @description: 根据id回显
     * @param: [labelId]
     * @return: com.jk.smartelderlycare.dto.SysLabel
     * @author hhk
     * @date: 2024/11/14 15:37
     */
    @Override
    public SysLabel findSysLabelByLabelId(Long labelId) {
        return sysLabelService.findSysLabelByLabelId(labelId);
    }
    /**
     * @description: 修改
     * @param: [sysLabel]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 15:38
     */
    @Override
    public void updataSysLabel(SysLabel sysLabel) {
        sysLabelService.updataSysLabel(sysLabel);
    }
    /**
     * @description: 状态修改
     * @param: [sysLabel]
     * @return: void
     * @author hhk
     * @date: 2024/11/14 16:05
     */
    @Override
    public void updateStatus(SysLabel sysLabel) {
        sysLabelService.updateStatus(sysLabel);
    }
}
